package pcc.context;

import java.security.acl.Owner;
import java.util.Arrays;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.core.Ordered;

public class MyProcessor implements BeanPostProcessor ,  BeanFactoryPostProcessor ,Ordered{
	
	/*
	 * PostProcessor
	 */
	public Object postProcessBeforeInitialization(Object bean, String beanName)
			throws BeansException {
		System.out.println("before:"+ beanName);
		return bean;
	}

	public Object postProcessAfterInitialization(Object bean, String beanName)
			throws BeansException {
		System.out.println("after:"+ beanName);
		return bean;
	}
	/*
	 * PostProcessor
	 */

	public void postProcessBeanFactory(
			ConfigurableListableBeanFactory beanFactory) throws BeansException {
		System.out.println(Arrays.asList(beanFactory.getBeanDefinitionNames()));
		
		
	}

	public int getOrder() {
		return LOWEST_PRECEDENCE;
	}
	

}
